{$sum_cant = 0}
{$sum_minu = 0}
<h1 style="text-align: center;">Programacion para la semana {$semana}</h1>
<div style="text-align:center;margin: 20px;">
    <input type="button" value="<<" onclick="window.location.href='http://servidor1:82/maquinado/index/cta3/{$semana-1}'"/>
    <input type="button" value=">>" onclick="window.location.href='http://servidor1:82/maquinado/index/cta3/{$semana+1}'"/>
</div>
<table align="center" border=1 cellspacing=0>
    <tr>
        <th>Maquina</th>
        <th>Prioridad</th> 
        <th>Pieza</th>
        <th>Cantidad</th>
            <th>Buenas</th>
            <th>Malas</th>
        <th>Minutos</th>
        <th>Horas</th>
        <th>T8</th>
        <th>T9</th>
    </tr>
    {foreach from=$tabla item=current}
    <tr style="background-color: {$current.color};">
        <td>{$current.Maquina}</td>
        <td>{$current.Prioridad}</td>
        <td>{$current.Pieza}</td>
        <td>{$current.Cantidad}</td>
        <td>{$current.Hechas}</td>
        <td>{$current.Rechazo}</td>
        {$sum_cant = $sum_cant+$current.Cantidad}
        
        <td>{$current.Minutos}</td>
        {$sum_minu = $sum_minu+$current.Minutos}
        <td>{($current.Minutos/60)|round:2}</td>
        <td>{(($current.Minutos/60)/8)|round:2}</td>
        <td>{(($current.Minutos/60)/9)|round:2}</td>
    </tr>
    {/foreach}
    <tr style="font-weight: bolder;">
        <td>Total</td>
        <td>&nbsp;</td>
        <td>{$sum_cant|number_format} Pzas</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>{$sum_minu|number_format} mins.</td>
        <td>{($sum_minu/60)|round:2}H.</td>
        <td>{(($sum_minu/60)/8)|round:2} turnos</td>
        <td>{(($sum_minu/60)/9)|round:2} turnos</td>
    </tr>
</table>
<p>&nbsp;</p>